package com.bmicpd.gzh.util;

import org.joda.time.DateTime;

/**
 * @author ytree
 */
public class GzhDateTimeUtils {

    /**
     * 时间戳转日期
     * @param timestamp 时间戳
     * @return String
     */
    public static String timestamp2Date(String timestamp){

        DateTime dateTime = new DateTime(Integer.parseInt(timestamp) * 1000L);
        return dateTime.toString("yyyy-MM-dd");

    }

    /**
     * 时间戳转日期时间
     * @param timestamp 时间戳
     * @return String
     */
    public static String timestamp2DateTime(String timestamp){

        DateTime dateTime = new DateTime(Integer.parseInt(timestamp) * 1000L);
        return dateTime.toString("yyyy-MM-dd hh:mm:ss");

    }
}
